#include <iostream>
#include <string>
#include "shm_buf.h"
#include <unistd.h>

static void consumer()
{
    const char *shm_name = "edge_client_cpp_py";
    SharedMemoryBuffer shmbuf(shm_name);

    while (true)
    {
        if (!shmbuf.readable())
            sleep(1);
        std::string read_data;
        shmbuf.read_shm(read_data);
        std::cout << "read_data: " << read_data << std::endl;
    }
}

int main(int argc, char *argv[])
{
    consumer();
    return 0;
}
